<?php
// No direct access
defined('_JEXEC') or die;

$fields = $this->fields;
$selectOrdering = JRequest::getInt('select_ordering');
$selectedValue = JRequest::getVar('selected_value');
?>


<select name="jform[join_field_on_<?php echo $selectOrdering; ?>][]" class="width-110">
	<option value="-">- Field -</option>
	<?php if(is_array($fields)): ?>
	<?php foreach ($fields as $key => $field): ?>
	<?php $selected = ($key == $selectedValue) ? 'selected="selected"' : null; ?>
	<option value="<?php echo $key; ?>" <?php echo $selected; ?>><?php echo $key; ?></option>
	<?php endforeach; ?>
	<?php endif; ?>
</select>